package exception;

/**
 * 异常地抛出
 */
public class ThrowDemo {
    public static void main(String[] args) {
        /*try {
            Student s = new Student(110);
            System.out.println(s.getAge());
        } catch (Exception e) {
            System.out.println("年龄格式不正确");
        }*/

        try {
            Student s = new Student(110);
            System.out.println(s.getAge());
        } catch (IllegalAgeException e) {
            e.printStackTrace();
        }
    }
}
